package java_012_zuoye04;

public class java05 {
	public static void main(String[] args) {
		String str = "abcdefg";
        reverse(str, 2, 5);
	}
	 public static void reverse(String str,int start,int end){

	        if(str != null){
	            char[] arr = str.toCharArray();
	            for(int x = start,y = end;x < y;x++,y--){
	                char temp = arr[x];
	                arr[x] = arr[y];
	                arr[y] = temp;
	            }
	            System.out.println(arr);
	        }
	    }
}
